from typing import Literal, Union

# 定义只接受特定值的参数
Direction = Literal["north", "south", "east", "west"]

def move(direction: Direction, steps: int) -> None:
    print(f"Moving {steps} steps to {direction}")

# 组合Literal类型
HttpMethod = Literal["GET", "POST", "PUT", "DELETE"]
SuccessCode = Literal[200, 201, 204]
ErrorCode = Literal[400, 401, 403, 404, 500]
StatusCode = Union[SuccessCode, ErrorCode]

def api_response(method: HttpMethod, status: StatusCode) -> None:
    print(f"{method} request returned status {status}")